package generator.equation;


public class MutualInformation {
	
	private double fXD;
	private double fYD;
	private double fXYD;
	private long RowsD;
	double result;
	
	public MutualInformation(double fX, double fY, double fXY, long Rows){
		fXD = fX;
		fYD = fY;
		fXYD = fXY;
		RowsD = Rows;
	}
	
	public double getResult(){
		Arith compute = new Arith();
	//	System.out.println(Math.log(compute.div(fXYD, compute.mul(fXD, fYD)) * 30000) + "," + fXYD / 30000);
//		result = fXYD / 30000 * Math.log(fXYD / (fXD * fYD) * 30000);
		double result1 = compute.div(fXYD, RowsD);
		double result2 = Math.log(compute.div(fXYD, compute.mul(fXD, fYD)) * RowsD);
		result = compute.mul(result1, result2);
	//	System.out.println("getResult: " + result);
		return result;
	}
	
}
